<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" />
	<!-- 全屏 -->
	<meta name="apple-mobile-web-app-capable" content="yes" />
	<!-- 上方栏显示 -->
	<meta name="apple-mobile-web-app-status-bar-style" content="black" />
	<!-- 不自动识别号码 -->
	<meta name="format-detection" content="telephone=no">
	<!-- Include js plugin -->
	<title>我的订单</title>
	<link rel="stylesheet" href="/static/wap/skin/css/layout.css">
	<link rel="stylesheet" href="/static/wap/skin/css/demos.css">
	<link rel="stylesheet" href="/static/wap/weui/css/weui.min.css">
	<link rel="stylesheet" href="/static/wap/weui/css/jquery-weui.min.css">
</head>
<body>
<header class="brB">
	<div class="h_top">
		<div class="hLeft"><a href="/my/home" class="icoH icoReturn mt20"></a></div>
		<div class="hCenter"><span class="tit c-3ac9af">我的订单</span></div>
	</div>
</header>
<div class="warp">
	<div class="b-FFFFFF ptb20 brB">
    	<div style="padding:0 10%;">
            <div class="layout-box kechen_tab tac u3">
                <a class="box-col " href="/my/orders">视频课</a>
                <a class="box-col " href="/my/orders_zhibo">直播课</a>
                <a class="box-col curr" href="/my/orders_banke">面授课</a>
                <a class="box-col" href="/my/orders_tiku">题库</a>
                <a class="box-col" href="/my/orders_shixun">实训</a>
            </div>
        </div>
    </div>
    <div class="fix public-tab mt20">
    	<div class="mt b-FFFFFF layout-box tac LH80 oh brB">
        	<div class="sp box-col"><span><a href="/my/orders_banke/index/-1/<{$data['order_num']}>/<{$data['begin_time']}>/<{$data['end_time']}>" class="<{if $data['status'] == -1}>curr<{/if}>">全部</a></span></div>
        	<div class="sp box-col"><span><a href="/my/orders_banke/index/0/<{$data['order_num']}>/<{$data['begin_time']}>/<{$data['end_time']}>" class="<{if $data['status'] == 0}>curr<{/if}>">待付款</a></span></div>
        	<div class="sp box-col"><span><a href="/my/orders_banke/index/1/<{$data['order_num']}>/<{$data['begin_time']}>/<{$data['end_time']}>" class="<{if $data['status'] == 1}>curr<{/if}>">已付款</a></span></div>
        	<div class="sp box-col"><span><a href="/my/orders_banke/index/2/<{$data['order_num']}>/<{$data['begin_time']}>/<{$data['end_time']}>" class="<{if $data['status'] == 2}>curr<{/if}>">已完成</a></span></div>
        </div>
        <div class="mc LH80">
        	<div id="layui_flow">
                <{foreach from=$order item=item}>
            	<ul class="mt20 b-FFFFFF plr20">
                	<li class="brB">
                        订单编号  <{$item.order_num}>
                        <span class="r c-999999">
                            <{if $item['order_status']==0}>
                                <a class="c-3b9eeb" target="_blank" href="/order/pay/<{$item['order_id']}>">去付款</a>
                            <{elseif $item[ 'order_status']==1}>
                                已付款
                            <{elseif $item[ 'order_status']==2}>
                                交易成功
                            <{/if}>
                        </span>
                    </li>
                    <li class="brB ptb20">
                        <div class="layout-box">
                        <{foreach from=$item.order_products|json_decode item=oitem}>

                            <div class="ith_img2">
                                <a href="/banke/detail/<{$oitem->course_id}>"><span class="mr20" style="height:5rem; width:5rem; background-image:url(<{$oitem->course_img}>)"></span></a>
                            </div>

                            <div class="box-col LH40">
                                <div class="fs26 oh h40"><a href="/banke/detail/<{$oitem->course_id}>"><{$oitem->title}></a></div>
                                <div class="fs24 c-666666 mt20">校区：<{$item.campus_name}></div>
                                <div class="fs24 c-999999">下单时间：<{$item['order_time']|date_format:'%Y-%m-%d %H:%M:%S'}></div>
                                <!-- <div class="fs26 mt20"><span class="c-fa3838">¥<{$item.total_order_amount}></span><span class="fs22 c-999999 r">&times;<{$oitem->quantity}></span></div> -->
                            </div>
                            <{/foreach}>
                        </div>
                    </li>
                	<li class="tar ptb20 LH60"></li>
                </ul>
                <{/foreach}>
            </div>
        </div>
    </div>
    
</div>
<link href="/static/public/layer/src/css/layui.css" rel="stylesheet">
<script src="/static/public/jquery-1.11.1.min.js" type="text/javascript"></script>
<script src="/static/public/layer/src/layui.js"></script>
<script>
layui.use('flow', function(){
  	var flow = layui.flow;
  	flow.load({
    	elem: '#layui_flow' //流加载容器
    	,isAuto:false
    	,scrollElem: '#layui_flow' //滚动条所在元素，一般不用填，此处只是演示需要。
    	,done: function(page, next){ //执行下一页的回调
      		//模拟数据插入
	      	setTimeout(function(){
	        	var lis = [];
	        	if(page > 1){
	        		$.ajax({
		                type: "GET",
		                url: "/my/orders_banke/index/<{$data.status}>/<{$data.order_num}>/<{$data.begin_time}>/<{$data.end_time}>/"+page,
		                dataType:"json",
		                success: function(result){
		                    if(result){
		                    	$.each(result,function(i,j){
									html = '';
									html += '<ul class="mt20 b-FFFFFF plr20">';
									html += '<li class="brB">';
                        			html += '订单编号  ' + j.order_num;
                        			html += '<span class="r c-999999">';
                            		if(j.order_status == 0){
                            			html += '<a class="c-3b9eeb" target="_blank" href="/order/pay/'+j.order_id+'">去付款</a>';
                            		}else if(j.order_status == 1){
                            			html += '已付款';
                            		}else{
                            			html += '交易成功';
                            		}
                                	html += '</span> </li>';
                            
                        			html += '<li class="brB ptb20">';
				                    html += '<div class="layout-box">';
				                    html += '<div class="ith_img2">';
				                    var products = eval("("+j.order_products+")")
				                    $.each(products,function(t,oj){
					                    html += '<a href="/banke/detail/'+oj.course_id+'"><span class="mr20" style="height:5rem; width:5rem; background-image:url('+oj.course_img+')"></span></a>';
					                    html += '</div>';
					                    html += '<div class="box-col LH40">';
					                    html += '<div class="fs26 oh h40"><a href="/banke/detail/'+oj.course_id+'">'+oj.title+'</a></div>';
					                    html += '<div class="fs24 c-666666 mt20">校区：'+j.campus_name+'</div>';
					                    html += '<div class="fs24 c-999999">下单时间：'+j.order_time+'</div>';
					                    html += '<div class="fs26 mt20"><span class="c-fa3838">¥'+oj.price+'</span><span class="fs22 c-999999 r">&times;'+oj.quantity+'</span></div>';
					                    html += '</div></div></li>';
				                    });
				                	html += '<li class="tar ptb20 LH60"></li></ul>';
				                	// lis.push('<li>'+ ( (page-1)*8 + i + 1 ) +'</li>')
				                	lis.push(html)
				                	$("#layui_flow").find("ul:last").after(html)
				                	// console.log(html)
								});

		                    }
		                }
		            });
	        	}
	        	
	        //执行下一页渲染，第二参数为：满足“加载更多”的条件，即后面仍有分页
	        //pages为Ajax返回的总页数，只有当前页小于总页数的情况下，才会继续出现加载更多
	        	next(lis.join(''), page < "<{$count-1}>"); //假设总页数为 10
	      	}, 500);
    	}
  	});
});
</script>
</body>
</html>